package com.cxx.service.ServiceImpl;

import com.cxx.mapper.ApproveMapper;
import com.cxx.pojo.User;
import com.cxx.service.ApproveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ApproveServiceImpl implements ApproveService {

    @Autowired
    private ApproveMapper approveMapper;
    @Override
    public Integer approveNum() {
        return approveMapper.approveNum();
    }

    @Override
    public List<User> waitApprove() {
        return approveMapper.waitApprove();
    }

    @Override
    public Integer approve(String userName) {
        return approveMapper.approve(userName);
    }

    @Override
    public Integer messageNum(String account) {
        Integer commentNum=approveMapper.commentNum(account);
        Integer replayNum=approveMapper.replayNum(account);
        Integer messageNum=commentNum+replayNum;
        return messageNum;
    }
}
